<?php

    /**
    * Edit login information
    * For project: Kurtulus Law, Credit
    * 
    * @author trungdt
    * @since Aug 29
    * @copyright Absoft Viet Nam
    */
    if (!defined('EXPONENT')) exit('');

    if (exponent_users_isAdmin()) {
        // for Login information
        $textitem = null;
        
        $loc->mod="textmodule";
        $location = serialize($loc);
        $location_bak=$location;
        $logininfo = $db->selectObject('textitem',"location_data='" . $location . "'");
        if (!$logininfo)
        {
            $logininfo=null;
            $logininfo->text="";
        }
        
        // for login headline sentence
        $location = unserialize($location);
        $location->src=$location->src."_head";
        $location=serialize($location);
        $logininfo_head = $db->selectObject('textitem',"location_data='" . $location . "'");
        if (!$logininfo_head)
        {
            $logininfo_head=null;
            $logininfo_head->text="";
        }

        // for login mobile sentence
        $location = unserialize($location_bak);
        $location->src=$location->src."_mobile";
        $location=serialize($location);
        $mobile = $db->selectObject('textitem',"location_data='" . $location . "'");
        if (!$mobile)
        {
            $mobile=null;
            $mobile->text="";
        }
        if (exponent_permissions_check('edit',$loc)) {
            $template = new template('loginmodule','_form_edit_logininfo',$loc);
            $template->assign("logininfo", $logininfo);
            $template->assign("head", $logininfo_head);
            $template->assign("mobile", $mobile);
            $template->output();
             exponent_sessions_set("AB_THEME_TOP_CONTAINER_SRC","top_systemmodule_".LANG);
    exponent_sessions_set("AB_THEME_TOP_CONTAINER_TYPE","textmodule");
        } else {
                echo exponent_http_error(403);
        }
    } else {
        echo exponent_http_error(403);
    }

?>